package com.naiterui.ehp.bs.ds.modules.order.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.naiterui.ehp.bs.ds.common.constants.DsName;
import com.naiterui.ehp.bs.ds.modules.order.entity.Order;
import com.naiterui.ehp.bs.ds.modules.order.vo.BaseOrderInfoVO;
import com.naiterui.ehp.bs.ds.modules.order.vo.LogisticsCompanyVO;
import com.naiterui.ehp.bs.ds.modules.order.vo.OrderDetailVO;
import com.naiterui.ehp.bs.ds.modules.order.vo.OrderExcelVO;
import com.naiterui.ehp.bs.ds.modules.order.vo.OrderVO;
import com.naiterui.ehp.bs.ds.modules.order.vo.PrintOrderDetailVO;

@DS(DsName.EHP)
public interface OrderMapper extends BaseMapper<Order> {

    OrderDetailVO getByIdAndWarehouseId(@Param("orderId") Long orderId, @Param("warehouseId") Long warehouseId);

    Page<OrderVO> getPage(@Param("page") IPage<OrderVO> page, @Param("ew") Wrapper<OrderVO> entityWrapper);

    Long getStatistical(@Param("warehouseId") Long warehouseId, @Param("date") String date);

    List<OrderVO> getByPatientId(@Param("pateintId") Long pateintId);

    List<LogisticsCompanyVO> getLogisticsCompanyList();

    Long getByOrderSn(@Param("orderSn") String orderSn);

    BaseOrderInfoVO getOrderInfoByOrderSn(@Param("orderSn") String orderSn);

    List<OrderExcelVO> exportOrder(@Param("ew") Wrapper<?> entityWrapper);

    PrintOrderDetailVO getPrintOrderDetailById(@Param("orderId") Long orderId);

    Long countOrder(@Param("warehouseId") Long warehouseId, @Param("date") String date);

}
